package com.dsg.entity.apply;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 业务申请单
 * </p>
 *
 * @author system
 * @since 2020-07-12
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("dsg_apply_bill")
@ApiModel(value="DsgApplyBill对象", description="业务申请单")
public class DsgApplyBill implements Serializable {
    private static final long serialVersionUID = 1L;

    public enum AppStatus {
        draft(0), committed(1), cancelled(2), approved(3);
        int code;

        AppStatus(int code) {
            this.code = code;
        }

        public int getCode() {
            return code;
        }
    }

    public static final int OWNS_TYPE_COM = 1;
    public static final int OWNS_TYPE_CUS = 2;

    /**草稿(在Sales入機列表顯示為“已提交”)*/
    public static final int APP_STATUS_DRAFT = 0;
    /**已提交（未對單）*/
    public static final int APP_STATUS_1 = 1;
    /**已取消（拒絕單）*/
    public static final int APP_STATUS_2 = 2;
    /**待跟進（對單時）*/
    public static final int APP_STATUS_3 = 3;
    /**已審批（已對單/完核對）*/
    public static final int APP_STATUS_4 = 4;
    /**已完成（审批通过的所有车辆车都已派咭成功）*/
    public static final int APP_STATUS_5 = 5;
    /**(Sales入機)草稿*/
    public static final int APP_STATUS_6 = 6;
    /**作廢*/
    public static final int APP_STATUS_8 = 8;
    /**已生效（修改油咭密碼）*/
    public static final int APP_STATUS_7 = 7;
    /**已操作（修改油咭密碼）*/
    public static final int APP_STATUS_9 = 9;

    /**Sales紙單新申請/加車*/
    public static final int APP_TYPE_1 = 1;
    /**Sales Ipad新申請/加車*/
    public static final int APP_TYPE_2 = 2;
    /**CS新申請*/
    public static final int APP_TYPE_3 = 3;
    /**CS轉車牌*/
    public static final int APP_TYPE_4 = 4;
    /**CS轉油種*/
    public static final int APP_TYPE_5 = 5;
    /**CS加Payment*/
    public static final int APP_TYPE_6 = 6;
    /**CS加車*/
    public static final int APP_TYPE_7 = 7;
    /**開咭*/
    public static final int APP_TYPE_8 = 8;
    /**補咭*/
    public static final int APP_TYPE_9 = 9;
    /**停咭*/
    public static final int APP_TYPE_10 = 10;
    /**取消油咭*/
    public static final int APP_TYPE_11 = 11;
    /**更改油咭限額*/
    public static final int APP_TYPE_12 = 12;
    /**過期補領*/
    public static final int APP_TYPE_13 = 13;
    /**修改油咭密碼*/
    public static final int APP_TYPE_14 = 14;
    /**轉移油咭（現有客戶->現有客戶）*/
    public static final int APP_TYPE_15 = 15;
    /**轉移油咭（現有客戶->新客戶）*/
    public static final int APP_TYPE_16 = 16;
    /**對單轉車牌*/
    public static final int APP_TYPE_17 = 17;
    /**對單轉油種*/
    public static final int APP_TYPE_18 = 18;
    /**對單加車*/
    public static final int APP_TYPE_19 = 19;
    /**交易賬目*/
    public static final int APP_TYPE_20 = 20;
    /**現金咭新申請*/
    public static final int APP_TYPE_21 = 21;
    /**現金咭Sales紙單新申請*/
    public static final int APP_TYPE_22 = 22;
    /**現金咭Sales Ipad新申請/加車*/
    public static final int APP_TYPE_23 = 23;
    /**現金咭CS加車*/
    public static final int APP_TYPE_24 = 24;
    /**現金咭CS轉車牌*/
    public static final int APP_TYPE_25 = 25;
    /**現金咭對單轉車牌*/
    public static final int APP_TYPE_26 = 26;
    /**現金咭對單加車*/
    public static final int APP_TYPE_27 = 27;
    /**現金咭補咭*/
    public static final int APP_TYPE_28 = 28;
    /**現金咭取消油咭*/
    public static final int APP_TYPE_29 = 29;
    /**新增繳款資料*/
    public static final int APP_TYPE_30 = 30;

    /**記賬*/
    public static final int KEEP_TYPE_BOOK = 1;
    /**現金*/
    public static final int KEEP_TYPE_CASH = 2;

    public static final int IS_MATCH_Y = 1;
    public static final int IS_MATCH_N = 0;

    /**已保存*/
    public static final int IS_SAVE_Y = 1;
    /**未保存*/
    public static final int IS_SAVE_N = 0;

    /**通過*/
    public static final int APPROVE_STATUS_AGREE = 1;
    /**拒絕*/
    public static final int APPROVE_STATUS_DISAGREE = 0;

    @TableField(exist = false)
    @ApiModelProperty(value = "问卷调查")
    private DsgApplyQuestion question;

    @TableField(exist = false)
    @ApiModelProperty(value = "公司或个人")
    private String cusOrCom;

    @TableField(exist = false)
    @ApiModelProperty(value = "客戶編號")
    private String cusNo;

    @TableField(exist = false)
    @ApiModelProperty(value = "资料类型")
    private String ownsType;

    @TableField(exist = false)
    @ApiModelProperty(value = "車牌號碼")
    private String carNo;

    @TableField(exist = false)
    @ApiModelProperty(value = "油種")
    private String carOilType;

    @TableField(exist = false)
    private String cardType;

    @TableId("OID")
    private String oid;

//    車ID(CS轉車牌、轉油種時使用)
    @ApiModelProperty(value = "車id")
    @TableField("CAR_OID")
    private String carOid;

    @ApiModelProperty(value = "记账类型")
    @TableField(value = "KEEP_TYPE")
    private Integer keepType;

    @ApiModelProperty(value = "申请类型")
    @TableField("APP_TYPE")
    private Integer appType;

    @ApiModelProperty(value = "系統備註")
    @TableField("SYS_REMARKS")
    private String sysRemarks;

    @ApiModelProperty(value = "主申请单号")
    @TableField("MAIN_NO")
    private String mainNo;

    @ApiModelProperty(value = "申请单号")
    @TableField("APP_NO")
    private String appNo;

    @TableField("IS_SAVE")
    @ApiModelProperty(value = "是否CS加車已保存")
    private Integer isSave;

    @TableField("P_C_O")
    @ApiModelProperty(value = "是否接受推銷電話")
    private Integer pCO;

    @ApiModelProperty(value = "是否自取")
    @TableField("SELF_ACC")
    private Integer selfAcc;

    @ApiModelProperty(value = "客介紹客")
    @TableField("IS_CUS_INTRO")
    private Integer isCusIntro;

    @ApiModelProperty(value = "不減折扣")
    @TableField("IS_DISCOUNT")
    private Integer isDiscount;

    @ApiModelProperty(value = "是否問題單")
    @TableField("IS_PROBLEM")
    private Integer isProblem;

    @ApiModelProperty(value = "問題單原因")
    @TableField("PROBLEM_DESC")
    private String problemDesc;

    @JsonFormat(pattern = "dd/MM/yyyy  HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "申请日期")
    @TableField("APPLY_TIME")
    private Date applyTime;

    @ApiModelProperty(value = "销售队伍")
    @TableField("SALE_TEAM")
    private String saleTeam;

    @ApiModelProperty(value = "销售员编号")
    @TableField("SALER_NO")
    private String salerNo;

    @ApiModelProperty(value = "对单时间")
    @TableField("CHECK_TIME")
    private Integer checkTime;

    @JsonFormat(pattern = "dd/MM/yyyy  HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "返单日期")
    @TableField("RE_DATE")
    private Date reDate;

    @ApiModelProperty(value = "返单地点")
    @TableField("RE_ADDR")
    private String reAddr;

    @ApiModelProperty(value = "内部备注")
    @TableField("IN_REMARKS")
    private String inRemarks;

    @ApiModelProperty(value = "销售员备注")
    @TableField("SALER_REMARKS")
    private String salerRemarks;

    @ApiModelProperty(value = "是否对单")
    @TableField("IS_MATCH")
    private Integer isMatch;

    @ApiModelProperty(value = "补咭/取消咭/停咭 /开咭/修改密码/过期补领/取消返咭 原因")
    @TableField("REMARK")
    private String remark;

    @ApiModelProperty(value = "是否翻生單")
    @TableField("RE_NEW")
    private Integer reNew;

    @ApiModelProperty(value = "创建人")
    @TableField("CREATER")
    private String creater;

    @JsonFormat(pattern = "dd/MM/yyyy  HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "创建时间")
    @TableField("CREATE_TIME")
    private Date createTime;

    @ApiModelProperty(value = "更新人")
    @TableField("UPDATER")
    private String updater;

    @JsonFormat(pattern = "dd/MM/yyyy  HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "更新时间")
    @TableField("UPDATE_TIME")
    private Date updateTime;

    @ApiModelProperty(value = "申请单状态")
    @TableField("APP_STATUS")
    private Integer appStatus;

    @ApiModelProperty(value = "原申请单状态")
    @TableField("PRE_APP_STATUS")
    private Integer preAppStatus;

    @ApiModelProperty(value = "問題單")
    @TableField("REQ_FORM")
    private String reqForm;

    @ApiModelProperty(value = "郵寄地址")
    @TableField("MAIL_ADDR")
    private String mailAddr;

    @ApiModelProperty(value = "对单编号")
    @TableField("CHECK_NO")
    private String checkNo;

    @ApiModelProperty(value = "付款方式")
    @TableField("PAY_TYPE")
    private String payType;

    /**
     * 企業編號
     */
    @TableField(value = "ENT_CODE")
    @ApiModelProperty(value = "企業編號", name = "entCode")
    private String entCode;

    @ApiModelProperty(value = "佣金状态")
    @TableField("COMMISSION_STATUS")
    private int commissionStatus;

    @JsonFormat(pattern = "dd/MM/yyyy  HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "取消日期")
    @TableField("CANCEL_TIME")
    private Date cancelTime;

    @TableField(value = "PAY_ID")
    @ApiModelProperty(value = "付款資料OID", name = "payId")
    private String payId;

    @TableField(value = "CUS_ID")
    @ApiModelProperty(value = "客户/公司ID", name = "cusId")
    private String cusId;

    @TableField(value = "APPROVER")
    @ApiModelProperty(value = "批核人")
    private String approver;

    @TableField(value = "APPROVE_STATUS")
    @ApiModelProperty(value = "批核狀態")
    private Integer approveStatus;

    @TableField(exist = false)
    private String userId;

    @TableField(exist = false)
    private String payAccountNo;
}
